<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Kafka ISR机制深度解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background-color: #f8fafc;
            color: #1e293b;
            line-height: 1.6;
        }
        .hero-bg {
            background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        .highlight {
            position: relative;
            z-index: 1;
        }
        .highlight::before {
            content: "";
            position: absolute;
            left: 0;
            bottom: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(37, 99, 235, 0.2);
            z-index: -1;
            transform: scaleX(0);
            transform-origin: right;
            transition: transform 0.3s ease;
        }
        .highlight:hover::before {
            transform: scaleX(1);
            transform-origin: left;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 0.8;
            margin-right: 0.5rem;
            margin-top: 0.3rem;
            color: #1e3a8a;
            font-weight: 700;
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero-bg text-white py-20 md:py-32 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">Kafka ISR机制<br><span class="text-blue-200">高可用性的核心设计</span></h1>
                    <p class="text-xl text-blue-100 mb-8">深入解析Kafka如何通过In-Sync Replicas机制确保数据一致性和高可用性</p>
                    <div class="flex space-x-4">
                        <a href="#isr-definition" class="bg-white text-blue-600 px-6 py-3 rounded-lg font-medium hover:bg-blue-50 transition duration-300 flex items-center">
                            <i class="fas fa-book-open mr-2"></i> 开始阅读
                        </a>
                        <a href="#data-flow" class="border-2 border-blue-300 text-blue-100 px-6 py-3 rounded-lg font-medium hover:bg-blue-900 transition duration-300 flex items-center">
                            <i class="fas fa-project-diagram mr-2"></i> 数据流图
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-sm border border-blue-200 border-opacity-20">
                        <div class="mermaid">
                            graph LR
                            A[Producer] -->|发布消息| B[Leader]
                            B -->|同步数据| C[Follower1]
                            B -->|同步数据| D[Follower2]
                            C & D -->|确认同步| B
                            B -->|ISR成员| E[ISR List]
                            B -->|故障检测| F[Zookeeper]
                            F -->|选举新Leader| G[New Leader]
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-5xl px-4 py-12">
        <!-- Definition Section -->
        <section id="isr-definition" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">1. ISR的定义</h2>
            </div>
            <div class="bg-white rounded-xl p-8 card">
                <div class="flex flex-col md:flex-row">
                    <div class="md:w-2/3 mb-6 md:mb-0">
                        <p class="text-gray-700 mb-6 drop-cap">ISR（In-Sync Replicas）是Kafka高可用性和数据一致性的核心机制。它是一个包含当前分区数据副本的集合，所有副本都与主副本（Leader）保持同步。</p>
                        <div class="bg-blue-50 border-l-4 border-blue-500 p-4 mb-6">
                            <p class="text-blue-800 font-medium"><i class="fas fa-info-circle mr-2"></i>关键作用：ISR确保所有副本的数据都与Leader副本一致，从而保障数据的高可用性和一致性。</p>
                        </div>
                        <div class="flex items-start mb-4">
                            <div class="bg-blue-100 p-2 rounded-full mr-3 flex-shrink-0">
                                <i class="fas fa-sync-alt text-blue-600"></i>
                            </div>
                            <p class="text-gray-700">ISR中的Follower副本通过不断从Leader拉取消息来保持同步状态。当Follower副本落后太多或长时间未同步时，会被移出ISR列表。</p>
                        </div>
                    </div>
                    <div class="md:w-1/3 md:pl-8">
                        <div class="bg-gray-50 p-6 rounded-lg border border-gray-200">
                            <h3 class="font-bold text-lg text-gray-800 mb-3 flex items-center">
                                <i class="fas fa-lightbulb text-yellow-500 mr-2"></i> 技术要点
                            </h3>
                            <ul class="space-y-3">
                                <li class="flex items-start">
                                    <span class="bg-blue-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">1</span>
                                    <span>ISR = Leader + 同步的Followers</span>
                                </li>
                                <li class="flex items-start">
                                    <span class="bg-blue-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">2</span>
                                    <span>只有ISR中的副本才能成为新Leader</span>
                                </li>
                                <li class="flex items-start">
                                    <span class="bg-blue-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">3</span>
                                    <span>生产者可配置等待ISR确认</span>
                                </li>
                                <li class="flex items-start">
                                    <span class="bg-blue-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">4</span>
                                    <span>通过replica.lag.time.max.ms控制同步阈值</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Leader and Follower Section -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">2. Leader和Follower的角色</h2>
            </div>
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl p-8 card">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-full mr-4">
                            <i class="fas fa-crown text-blue-600 text-xl"></i>
                        </div>
                        <h3 class="text-2xl font-bold text-gray-800">Leader副本</h3>
                    </div>
                    <p class="text-gray-700 mb-4">每个Kafka分区都有一个Leader副本，负责处理所有的读写请求。Leader副本协调数据的写入和读取，是生产者和消费者交互的主要入口。</p>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>接收生产者发送的所有消息</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>维护分区的ISR列表</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>处理消费者读取请求</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>监控Follower副本的同步状态</span>
                        </li>
                    </ul>
                </div>
                <div class="bg-white rounded-xl p-8 card">
                    <div class="flex items-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-full mr-4">
                            <i class="fas fa-users text-purple-600 text-xl"></i>
                        </div>
                        <h3 class="text-2xl font-bold text-gray-800">Follower副本</h3>
                    </div>
                    <p class="text-gray-700 mb-4">除了Leader副本外，其他副本都是Follower副本。Follower副本从Leader那里复制数据，并保持数据的同步，准备在Leader故障时接管。</p>
                    <ul class="space-y-2 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>定期从Leader拉取最新消息</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>向Leader发送同步状态报告</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>在Leader故障时可能成为新Leader</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>提供数据冗余保障</span>
                        </li>
                    </ul>
                </div>
            </div>
        </section>

        <!-- ISR Management Section -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">3. ISR的管理机制</h2>
            </div>
            <div class="bg-white rounded-xl p-8 card">
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-sign-in-alt text-green-500 mr-3"></i> 加入ISR的条件
                        </h3>
                        <p class="text-gray-700 mb-6">当一个Follower副本成功地从Leader副本中拉取数据并保持同步时，它会被加入到ISR列表中。Kafka通过以下标准判断副本是否同步：</p>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <span class="bg-green-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">1</span>
                                <span>副本的日志末端偏移量(LEO)与Leader的LEO差距在阈值内</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-green-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">2</span>
                                <span>副本与Leader保持心跳连接</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-green-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">3</span>
                                <span>副本的同步延迟不超过replica.lag.time.max.ms配置(默认10秒)</span>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-sign-out-alt text-red-500 mr-3"></i> 移出ISR的条件
                        </h3>
                        <p class="text-gray-700 mb-6">如果一个Follower副本落后于Leader副本的数据，或者与Leader副本的连接中断，该副本会被移出ISR列表。常见原因包括：</p>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <span class="bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">1</span>
                                <span>副本同步落后超过replica.lag.time.max.ms阈值</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">2</span>
                                <span>副本与Leader失去网络连接</span>
                            </li>
                            <li class="flex items-start">
                                <span class="bg-red-500 text-white text-xs font-bold rounded-full w-5 h-5 flex items-center justify-center mr-2 mt-0.5">3</span>
                                <span>副本进程崩溃或响应超时</span>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="mt-8 p-6 bg-blue-50 rounded-lg border border-blue-200">
                    <h4 class="font-bold text-lg text-blue-800 mb-3 flex items-center">
                        <i class="fas fa-cogs mr-2"></i> 关键配置参数
                    </h4>
                    <div class="grid md:grid-cols-3 gap-4">
                        <div class="bg-white p-4 rounded border">
                            <div class="font-mono text-sm text-blue-600 mb-1">replica.lag.time.max.ms</div>
                            <p class="text-sm text-gray-700">Follower副本被认为不同步前的最大延迟时间(默认10000ms)</p>
                        </div>
                        <div class="bg-white p-4 rounded border">
                            <div class="font-mono text-sm text-blue-600 mb-1">min.insync.replicas</div>
                            <p class="text-sm text-gray-700">写入成功所需的最小ISR副本数(默认1)</p>
                        </div>
                        <div class="bg-white p-4 rounded border">
                            <div class="font-mono text-sm text-blue-600 mb-1">unclean.leader.election.enable</div>
                            <p class="text-sm text-gray-700">是否允许非ISR副本成为Leader(默认false)</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Data Flow Visualization -->
        <section id="data-flow" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">4. ISR数据流可视化</h2>
            </div>
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white rounded-xl p-6 card">
                    <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-project-diagram text-blue-500 mr-2"></i> ISR工作流程
                    </h3>
                    <div class="mermaid">
                        sequenceDiagram
                        participant P as Producer
                        participant L as Leader
                        participant F1 as Follower1(ISR)
                        participant F2 as Follower2(非ISR)
                        P->>L: 发送消息M
                        L->>F1: 复制消息M
                        F1-->>L: 确认接收
                        L->>F2: 尝试复制消息M
                        Note over F2: 同步延迟或失败
                        L->>L: 更新ISR列表
                        L-->>P: 确认写入(基于ISR)
                    </div>
                </div>
                <div class="bg-white rounded-xl p-6 card">
                    <h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-exchange-alt text-purple-500 mr-2"></i> Leader选举过程
                    </h3>
                    <div class="mermaid">
                        flowchart TD
                        A[Leader故障] --> B[Zookeeper检测]
                        B --> C{ISR中有可用副本?}
                        C -->|是| D[从ISR选举新Leader]
                        C -->|否| E[检查unclean.leader.election.enable]
                        E -->|true| F[从非ISR选举]
                        E -->|false| G[分区不可用]
                        D --> H[更新Leader和ISR]
                        F --> H
                        H --> I[恢复服务]
                    </div>
                </div>
            </div>
        </section>

        <!-- Consistency and Performance -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">5. 一致性与性能权衡</h2>
            </div>
            <div class="bg-white rounded-xl p-8 card">
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-shield-alt text-green-500 mr-3"></i> 数据一致性保障
                        </h3>
                        <p class="text-gray-700 mb-6">ISR机制为Kafka提供了强大的数据一致性保证：</p>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <div class="bg-green-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check text-green-600 text-xs"></i>
                                </div>
                                <span>只有同步(ISR)的副本才能成为Leader，避免数据丢失</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-green-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check text-green-600 text-xs"></i>
                                </div>
                                <span>生产者可配置acks=all等待所有ISR副本确认</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-green-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check text-green-600 text-xs"></i>
                                </div>
                                <span>min.insync.replicas确保写入足够副本</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-green-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check text-green-600 text-xs"></i>
                                </div>
                                <span>unclean.leader.election.enable=false防止数据不一致</span>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-tachometer-alt text-blue-500 mr-3"></i> 性能考量与优化
                        </h3>
                        <p class="text-gray-700 mb-6">ISR机制会在一定程度上影响性能，需谨慎配置：</p>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-exclamation-triangle text-blue-600 text-xs"></i>
                                </div>
                                <span>acks=all会增加写入延迟(等待所有ISR确认)</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-exclamation-triangle text-blue-600 text-xs"></i>
                                </div>
                                <span>较大的min.insync.replicas会降低可用性</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-lightbulb text-yellow-500 text-xs"></i>
                                </div>
                                <span>监控ISR大小和副本延迟至关重要</span>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-blue-100 p-1 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-lightbulb text-yellow-500 text-xs"></i>
                                </div>
                                <span>根据业务需求平衡一致性和延迟</span>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="mt-8 bg-gray-50 p-6 rounded-lg border border-gray-200">
                    <h4 class="font-bold text-lg text-gray-800 mb-4 flex items-center">
                        <i class="fas fa-table mr-2"></i> 配置建议参考表
                    </h4>
                    <div class="overflow-x-auto">
                        <table class="min-w-full bg-white">
                            <thead>
                                <tr class="bg-gray-100">
                                    <th class="py-3 px-4 text-left text-gray-700 font-medium">场景</th>
                                    <th class="py-3 px-4 text-left text-gray-700 font-medium">acks</th>
                                    <th class="py-3 px-4 text-left text-gray-700 font-medium">min.insync.replicas</th>
                                    <th class="py-3 px-4 text-left text-gray-700 font-medium">replica.lag.time.max.ms</th>
                                </tr>
                            </thead>
                            <tbody class="divide-y divide-gray-200">
                                <tr>
                                    <td class="py-3 px-4 text-gray-700">最高一致性</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">all</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">副本数-1</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">5000-10000</td>
                                </tr>
                                <tr>
                                    <td class="py-3 px-4 text-gray-700">平衡型</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">1</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">1</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">10000-30000</td>
                                </tr>
                                <tr>
                                    <td class="py-3 px-4 text-gray-700">最高吞吐量</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">0</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">1</td>
                                    <td class="py-3 px-4 font-mono text-blue-600">30000+</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>

        <!-- Monitoring and Management -->
        <section class="mb-12">
            <div class="flex items-center mb-8">
                <div class="h-1 bg-blue-500 w-12 mr-4"></div>
                <h2 class="text-3xl font-bold text-gray-800">6. ISR监控与管理</h2>
            </div>
            <div class="bg-white rounded-xl p-8 card">
                <div class="grid md:grid-cols-2 gap-8">
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-chart-line text-teal-500 mr-3"></i> 关键监控指标
                        </h3>
                        <p class="text-gray-700 mb-6">有效监控ISR状态对保障Kafka集群健康至关重要：</p>
                        <ul class="space-y-4">
                            <li>
                                <div class="font-medium text-gray-800 mb-1">ISR收缩率</div>
                                <div class="h-2 bg-gray-200 rounded-full overflow-hidden">
                                    <div class="h-full bg-red-500 rounded-full" style="width: 15%"></div>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">ISR列表收缩的频率和幅度</p>
                            </li>
                            <li>
                                <div class="font-medium text-gray-800 mb-1">副本延迟</div>
                                <div class="h-2 bg-gray-200 rounded-full overflow-hidden">
                                    <div class="h-full bg-yellow-500 rounded-full" style="width: 35%"></div>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">Follower与Leader的消息延迟</p>
                            </li>
                            <li>
                                <div class="font-medium text-gray-800 mb-1">Leader选举</div>
                                <div class="h-2 bg-gray-200 rounded-full overflow-hidden">
                                    <div class="h-full bg-blue-500 rounded-full" style="width: 5%"></div>
                                </div>
                                <p class="text-sm text-gray-600 mt-1">Leader切换的频率和原因</p>
                            </li>
                        </ul>
                    </div>
                    <div>
                        <h3 class="text-2xl font-bold text-gray-800 mb-4 flex items-center">
                            <i class="fas fa-tools text-orange-500 mr-3"></i> 管理最佳实践
                        </h3>
                        <p class="text-gray-700 mb-6">遵循这些实践可优化ISR机制：</p>
                        <div class="space-y-4">
                            <div class="flex items-start">
                                <div class="bg-orange-100 p-2 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check-circle text-orange-500"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">合理的副本分布</h4>
                                    <p class="text-sm text-gray-600">确保副本分布在不同的机架/可用区</p>
                                </div>
                            </div>
                            <div class="flex items-start">
                                <div class="bg-orange-100 p-2 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check-circle text-orange-500"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">容量规划</h4>
                                    <p class="text-sm text-gray-600">预留足够资源应对副本同步负载</p>
                                </div>
                            </div>
                            <div class="flex items-start">
                                <div class="bg-orange-100 p-2 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check-circle text-orange-500"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">参数调优</h4>
                                    <p class="text-sm text-gray-600">根据网络质量调整replica.lag.time.max.ms</p>
                                </div>
                            </div>
                            <div class="flex items-start">
                                <div class="bg-orange-100 p-2 rounded-full mr-3 flex-shrink-0">
                                    <i class="fas fa-check-circle text-orange-500"></i>
                                </div>
                                <div>
                                    <h4 class="font-medium text-gray-800">告警设置</h4>
                                    <p class="text-sm text-gray-600">对ISR收缩和副本延迟设置告警</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            sequenceDiagram: {
                useMaxWidth: true,
                height: 300
            }
        });
    </script>
</body>
</html>